@ECHO OFF

SETLOCAL ENABLEEXTENSIONS

SET TOPDIR=%~dp0
SET PATH=%TOPDIR%\tools\GNUmake;%TOPDIR%\tools\gcc-arm-none-eabi\bin;%PATH%


SET MODULE=%1

IF "%MODULE%" == "" (
	@ECHO PARAM ERROR
	@ECHO run such as:
	@ECHO     build.bat sample\00_basic
	@ECHO     build.bat sample\00_basic clean
	goto END_BAT_FILE
)

IF "%2" == "clean" (
	make -C %MODULE% clean
	goto END_BAT_FILE
)

make -C %MODULE%

:END_BAT_FILE
